<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>题库管理系统</title>
    <link rel="stylesheet" href="/css/admin.css">
    <script src="/js/admin.js"></script>
</head>
<body>
<div class="container">
    <header>
        <h1>题库管理终端</h1>
        <a href="login">退出登录</a>
    </header>
    <main>
        <section class="category-boxes">
            <div class="category-box" data-category="CET4">
                <h3>CET4</h3>
                <p>大学英语四级</p>
            </div>
            <div class="category-box" data-category="CET6">
                <h3>CET6</h3>
                <p>大学英语六级</p>
            </div>
            <div class="category-box" data-category="PE">
                <h3>PE</h3>
                <p>考研英语</p>
            </div>
        </section>
        <section class="main-content">
            <h2 id="category-title">请选择分类</h2>
            <div class="question-types" id="question-types">
                <p>请从上方选择一个分类查看题目类型。</p>
            </div>
            <div id="question-list">
                <p>尚未加载题目。请先选择分类和题目类型。</p>
                <!-- 分页控件将在这里动态生成 -->
            </div>
            <div id="question-form" class="hidden">
                <h3>编辑题目</h3>
                <form id="question-form-content">
                    <input type="hidden" id="question-id" name="question-id">
                    <div class="form-group">
                        <label for="content">题目内容:</label>
                        <textarea id="content" name="content" rows="4" required></textarea>
                    </div>
                    <div class="form-group">
                        <label for="answer">答案:</label>
                        <input type="text" id="answer" name="answer" required>
                    </div>
                    <div class="form-group">
                        <label for="analysis">解析:</label>
                        <textarea id="analysis" name="analysis" rows="4"></textarea>
                    </div>
                    <div class="form-group">
                        <label for="difficulty">难度:</label>
                        <textarea id="difficulty" name="difficulty"></textarea>
                    </div>
                    <div class="form-actions">
                        <button type="button" onclick="submitQuestion()">提交</button>
                        <button type="button" onclick="closeForm()" class="cancel-btn">取消</button>
                    </div>
                </form>
            </div>
        </section>
    </main>
</div>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</body>
</html>